package com.bjpowernode.boss.convert;

import cn.hutool.core.util.StrUtil;
import com.bjpowernode.boss.common.enums.PublicStatus;
import com.bjpowernode.boss.convert.help.CommonFun;
import com.bjpowernode.boss.dao.entity.UserInfo;
import com.bjpowernode.boss.mvc.models.vo.user.UserInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.Named;

import java.util.List;

@Mapper(componentModel = "spring",uses={CommonFun.class})
public interface UserConvert {

    List<UserInfoVo> toListUserInfoVo(List<UserInfo> userInfos);

    @Mappings({
            @Mapping(source = "createTime",target = "createTime",dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "status",target = "status",qualifiedByName = "transPublicStatus"),

    })
    UserInfoVo mapUserInfoVo(UserInfo userInfo);



}
